<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="org.apak.model.*" import="org.apak.control.*" import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Service order menu</title>
<script type="text/javascript"
	src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<link rel="stylesheet" href="./css/orderMenu.css" type="text/css" />
<script type="text/javascript" src="./js/customerViewNote.js"></script>
<script type="text/javascript" src="./apprisePlugin/apprise-1.5.full.js"></script>
<link rel="stylesheet" href="./apprisePlugin/apprise.css" type="text/css" />
</head>
<body>
<%
	ServiceOrder[] serviceOrderArray = (ServiceOrder[]) request.getAttribute("serviceOrderArray");
	boolean[] invoiceArray = (boolean[]) request.getAttribute("invoiceArray");
%>
<h2>Service order menu</h2>
<form action="serviceOrderMenu" method="post">
<%
	if(serviceOrderArray != null && invoiceArray != null) {
%>
<table id="mainTable">
<%
		for(int i = 0; i < serviceOrderArray.length; i++) {
			request.setAttribute("currentServiceOrderNumber", serviceOrderArray[i].getService_order());
%>
	<tr>
		<td>Note: </td>
		<td>
			<jsp:include page="customerNotesForCustomer.jsp" />
		</td>
	</tr>
	<tr>
		<td>Created: </td>
		<td>
			<%= serviceOrderArray[i].getCreated() %>
		</td>
	</tr>
	<tr>
		<td>Updated: </td>
		<td>
			<%= serviceOrderArray[i].getUpdated() %>
		</td>
	</tr>
	<tr>
		<td>Price: </td>
		<td>
			<%= serviceOrderArray[i].getPrice_total() %>
		</td>
	</tr>
	<tr>
		<td>Status: </td>
		<td>
			<%= serviceOrderArray[i].getSo_status_typeName() %>
		</td>
	</tr>
	<tr>
		<td>
		<%
			if(invoiceArray[i]) {
		%>
			<a href="./invoice?serviceOrder=<%= serviceOrderArray[i].getService_order() %>">Invoice</a>
		<%	} %>
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<jsp:include page="employeeNotesForCustomer.jsp" />
		</td>
	</tr>
	<tr>
		<td colspan="2">__________________________________________________________________________</td>
	</tr>
	<%
		}
	}
	%>
</table>
</form>
</body>
</html>